/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package secondProject;

import java.awt.List;
import java.awt.Point;
import java.util.Comparator;

/**
 *
 * @author asculx
 */
public class Caso implements Comparable<Caso>,Comparator<Caso> {

    Point Position;
    //int quantity;
    int distance;

    public Caso(int x , int y) {
     //   this.quantity = quantity;
        Position=new Point(x, y);
    }

    public Caso(Point Position,int distance) {
        this.Position = Position;
       // this.quantity = quantity;
        this.distance=distance;
    }

    @Override
    public int compareTo(Caso t)
    {
        int absDist=( Math.abs(distance - t.distance));
      // int absQuant=(Math.abs(quantity-t.quantity));

        if (distance > t.distance ){
            return 1;
        }else{
            return -1;
        }
    }

    public Point getPosition() {
        return Position;
    }

    public void setPosition(Point Position) {
        this.Position = Position;
    }

    //public int getQuantity() {
      //  return quantity;    }

    //public void setQuantity(int quantity) {
      //  this.quantity = quantity;    }

    public int getDistance() {
        return distance;
    }

    public void setDistance(int distance) {
        this.distance = distance;
    }

    @Override
    public String toString() {
        return "{"+Position.toString()+" distance= "+distance+"}";
    }

    @Override
    public int compare(Caso t, Caso t1) {
        throw new UnsupportedOperationException("Not supported yet.");
    }



}
